<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>

		<link rel="stylesheet"
			href="${pageContext.request.contextPath}/css/base.css" />
		<link rel="stylesheet"
			href="${pageContext.request.contextPath}/css/info-reg.css" />
		<title>已完成财务报表查询</title>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/js/jquery.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/js/common.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/js/WdatePicker.js"></script>
		<script type="text/javascript">
	$(".select-title").on("click", function() {
		$(".select-list").toggle();
		return false;
	});
	$(".select-list").on("click", "li", function() {
		var txt = $(this).text();
		$(".select-title").find("span").text(txt);
	});

	showRemind('input[type=text], textarea', 'placeholder');

	var oldColor;
	function choice(trObj) {
		oldColor = trObj.bgColor;
		trObj.bgColor = "yellow";
	}
	function leave(trObj) {
		trObj.bgColor = oldColor;
	}

	
	
	function skipPage(currentPage) {
		var url = '${pageContext.request.contextPath }/financeManager.action?method=queryFinishFinance&currPage=' + currentPage;

		url += '&finId=' + document.getElementById("fin_id").value;
		url += '&minCash=' + document.getElementById("minCash_id").value;
		url += '&maxCash=' + document.getElementById("maxCash_id").value;
		url += '&deptName=' + document.getElementById("deptName_id").value;
		url += '&finType=' + document.getElementById("finType_id").value;
		url += '&startOperaTime=' + document
				.getElementById("startOperaTime_id").value;
		url += '&endOperaTime=' + document.getElementById("endOperaTime_id").value;
		url += '&flag=back';
		window.location.href = url;
	}
	</script>
	<style type="text/css">
	td,p,form {
		font-size: 15px;
	}
	
	.search {
		width: 80%;
		margin: 0px auto;
	}
	
	a {
		text-decoration: none;
		cursor: pointer;
	}
	
	body{
	 background-image: url(${pageContext.request.contextPath}/images/forum5.jpg);
	}
	</style>
	</head>

	<body>

		<div class="title">
			<h2>
				已完成财务报表信息浏览
			</h2>
		</div>
		<div class="main" align="center">

			<div class="search">
				<p align="left" style="color: skyblue;">
					搜索条件
				</p>
				<form method="post"
					action="${pageContext.request.contextPath }/financeManager.action?method=queryFinishFinance">
					<input type="hidden" name="flag" value="back" />
					<table width="100%">
						<tr>
							<td align="center">
								操作编号：
								<input type="text" id="fin_id" name="finId"
									value="${requestScope.search.finId }" />
							</td>
							<td>
								操作金额：
								<input type="text" id="minCash_id" name="minCash"
									value="${requestScope.search.minCash<=0?'':requestScope.search.minCash }" />
								-
								<input type="text" id="maxCash_id" name="maxCash"
									value="${requestScope.search.maxCash<=0?'':requestScope.search.maxCash }" />
							</td>
							<td>
								部门名称：
								<select name="deptName" id="deptName_id" >
								<option value="${requestScope.search.deptName }">
									${requestScope.search.deptName }
								</option>
								<option value="">
									全部
								</option>
								<c:forEach items="${requestScope.deptlist}" var ="dept" varStatus="c">
									<option>
											${dept.deptName }
									</option>
								</c:forEach>
							</select>
							</td>
						</tr>
						<tr>
							<td>
								操作类型：
								<select name="finType" id="finType_id" >
								<option value="${requestScope.search.finType }">
									${requestScope.search.finType }
								</option>
								<option value="">
									全部
								</option>
								<c:forEach items="${requestScope.financeType}" var ="ftype" varStatus="c">
									<option>
											${ftype.finType }
									</option>
								</c:forEach>
							</select>
							</td>
							<td>
								操作时间：
								<input type="text" id="startOperaTime_id" name="startOperaTime"
									value="${requestScope.search.startOperaTime==null?'':requestScope.search.startOperaTime }" 
									onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
								-
								<input type="text" id="endOperaTime_id" name="endOperaTime"
									value="${requestScope.search.endOperaTime==null?'':requestScope.search.endOperaTime }" 
									onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
							</td>
							<td align="right">
								<input type="submit" value="搜索" style="background-image:url(images/toplight.png);width:150px " />
							</td>
						</tr>
					</table>
				</form>
			</div>

			<div style="height: 260px;">
				<table width="100%" align="center" cellspacing="0" cellpadding="0">
					<tr bgcolor="#e8c597">
						<td>
							操作编号
						</td>
						<td>
							操作金额
						</td>
						<td>
							部门名称
						</td>
						<td>
							操作 类型
						</td>
						<td>
							财务详情 
						</td>
						<td>
							操作时间
						</td>
						<td>
							附件信息
						</td>
						<td>
							处理状态
						</td>
						<td>
							处理人
						</td>
					</tr>
					<c:forEach items="${requestScope.financepage.data}" var="finance"
						varStatus="c">
						<tr 
							onmouseover=choice(this); onmouseout=leave(this);>
							<td>
								${finance.finId}
							</td>
							<td>
								${finance.finCash }
							</td>
							<td>
								${finance.deptName }
							</td>
							<td>
								${finance.finType }
							</td>
							<td>
								${finance.finDetail }
							</td>
							<td>
								${finance.operaTime }
							</td>
							<td>
								<a href="${pageContext.request.contextPath }/file/file_finance/${finance.finFile}">${finance.fileName}</a>
							</td>
							<td>
								${finance.finStatus}
							</td>
							
							<td>
								${finance.userName}
							</td>
							
						</tr>
					</c:forEach>
				</table>
			</div>
			<div>
			<br/>
				<table width="100%" align="center" cellspacing="0" cellpadding="0">
					<tr>
						<td width="20%">
							<a onclick="skipPage('1');">首页</a>
						</td>
						<td width="20%">
							<a
								onclick="skipPage('${requestScope.financepage.currentPage==1?1:requestScope.financepage.currentPage-1 }');">上一页</a>
						</td>
						<td width="20%">
							<a
								onclick="skipPage('${requestScope.financepage.currentPage==requestScope.financepage.totalPage?(requestScope.financepage.currentPage):(requestScope.financepage.currentPage+1) }');">下一页</a>
						</td>
						<td width="20%">
							<a onclick="skipPage('${requestScope.financepage.totalPage}');">末页</a>
						</td>
						<td>
							当前页码：${requestScope.financepage.currentPage
							}/${requestScope.financepage.totalPage}
						</td>
					</tr>
				</table>
			</div>
		</div>

	</body>
</html>

